<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body">
        <form class="layui-form" action="<?=url('ordergoods/add');?>">
          <div class="layui-form-item">
            <label class="layui-form-label">下单人</label>
            <div class="layui-input-block">
              <div class="layui-col-lg1">
                <button class="layui-btn layui-btn-sm layui-btn-normal" onclick="javascript:layer.open({title:'选择下单人',type:2,area: ['60%', '60%'],content:'<?=url('ordergoods/cuser')?>'});">
                    <i class="layui-icon">&#xe615;</i>
                    <cite>选择下单人</cite>
                </button>
              </div>
              <div class="layui-col-lg9">
                <input type="hidden" name="user_id" id="user_id" value="0" >
                <input type="text" id="user_id_info" value="" placeholder="下单人信息" disabled="disabled" autocomplete="off" class="layui-input">
              </div>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">服务项目</label>
            <div class="layui-input-block">
              <div class="layui-col-lg1">
                <button class="layui-btn layui-btn-sm layui-btn-normal" onclick="javascript:layer.open({title:'选择服务项目',type:2,area: ['60%', '60%'],content:'<?=url('ordergoods/cgoods')?>'});">
                    <i class="layui-icon">&#xe615;</i>
                    <cite>选择服务项目</cite>
                </button>
              </div>
              <div class="layui-col-lg9">
                <input type="hidden" name="goods_id" id="goods_id" value="0" >
                <input type="text" id="goods_id_info" value="" placeholder="服务项目信息" disabled="disabled" autocomplete="off" class="layui-input">
              </div>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">服务人</label>
            <div class="layui-input-block">
              <div class="layui-col-lg1">
                <button class="layui-btn layui-btn-sm layui-btn-normal" onclick="javascript:layer.open({title:'选择服务人',type:2,area: ['60%', '60%'],content:'<?=url('ordergoods/cworker')?>'});">
                    <i class="layui-icon">&#xe615;</i>
                    <cite>选择服务人</cite>
                </button>
              </div>
              <div class="layui-col-lg9">
                <input type="hidden" name="company_id" id="company_id" value="0" >
                <input type="hidden" name="worker_id" id="worker_id" value="0" >
                <input type="text" id="worker_id_info" value="" placeholder="服务人信息" disabled="disabled" autocomplete="off" class="layui-input">
              </div>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">客户姓名</label>
            <div class="layui-input-block">
              <input type="text" name="fw_name" placeholder="请输入客户姓名"  autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">客户电话</label>
            <div class="layui-input-block">
              <input type="text" name="fw_phone" placeholder="请输入客户电话"  autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">服务地址</label>
            <div class="layui-input-block">
              <input type="text" name="fw_address" placeholder="请输入服务地址"  autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">服务次数</label>
            <div class="layui-input-block">
              <input type="text" name="fw_times" value="1" required lay-verify="required" placeholder="请输入服务次数"  autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">开始时间</label>
              <div class="layui-input-inline">
                <input type="text" id="min_time" name="start_time" placeholder="开始时间" class="layui-input">
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">结束时间</label>
              <div class="layui-input-inline">
                <input type="text" id="max_time" name="end_time" placeholder="开始时间" class="layui-input">
              </div>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">服务价格</label>
            <div class="layui-input-block">
              <input type="text" name="price" required lay-verify="required" placeholder="请输入服务价格"  autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">成本价格</label>
            <div class="layui-input-block">
              <input type="text" name="cost_price" required lay-verify="required" placeholder="请输入成本价格"  autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
              <textarea placeholder="请输入备注" name="note" class="layui-textarea"></textarea>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-input-block">
              <button class="layui-btn" lay-submit lay-filter="myform">立即提交</button>
              <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
          </div>
        </form>
      </div>
    </div>
</div>
<script>
layui.use(['form'], function(){
  var $ = layui.$
  ,form = layui.form;
  form.render();
  //var ue = UE.getEditor('container');
});
//获取下单人信息
function cuser(rs){
  var index = layer.getFrameIndex(window.name);
  layer.close(index);
  var msg = "姓名:"+rs.name+"  电话:"+rs.phone+" 等级:"+rs.level;
  $("#user_id_info").val(msg);
  $("#user_id").val(rs.id);
  $("[name='fw_name']").val(rs.name);
  $("[name='fw_phone']").val(rs.phone);
  $("[name='fw_address']").val(rs.address);

}
//获取服务项目信息
function cgoods(rs){
  var index = layer.getFrameIndex(window.name);
  layer.close(index);
  var msg = "分类:"+rs.ptitle+"  产品:"+rs.title+" 参考价:"+rs.money;
  $("#goods_id_info").val(msg);
  $("#goods_id").val(rs.id);
}
//获取服务人信息
function cworker(company_id, company_title, rs){
  var index = layer.getFrameIndex(window.name);
  layer.close(index);
  var msg = "公司:"+company_title+"  服务人:"+rs.name;
  $("#worker_id_info").val(msg);
  $("#worker_id").val(rs.id);
  $("#company_id").val(company_id);
}

</script>
